<?php

namespace App\Models;


use Kalnoy\Nestedset\NodeTrait;

class SysDept extends ApiBaseModel
{
    use NodeTrait;

    protected $table = 'sys_dept';
    protected $fillable = [
        'parent_id',
        'dept_name',
        'order_num',
        'leader',
        'phone',
        'email',
        'status',
        'create_by',
        'update_by',
        'created_at',
        'updated_at',
    ];
    protected $casts = [
        'status' => 'string',
    ];

    public static function getMenuTree(){
        return self::select('id','dept_name as label','parent_id')->get();
    }
}
